package edu.hawaii.myisern.model;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

/**
 * Tests the user class.
 * 
 * Attributed and Inspired by Tim Fennell.
 * 
 * @author Ka Yee Leung
 * @author Ivan Wu
 * @author Chiao-Fen Zielinski-Liu
 * @author Michal Zielinski
 */
public class TestUser {
  
  /**
   * Tests.
   *
   * @throws Exception If problems occur
   */
  @Test
  @SuppressWarnings("deprecation") //TableCell.asText() is httpunit 1.5.3, needed due to Hackystat
  public void testUser() throws Exception {
    User defaultUser = new User();
    User overloadedUser = new User("username","password");
    overloadedUser.getPassword();
    
    defaultUser.setUsername("username");
    assertEquals("test equal username", "username", defaultUser.getUsername());
    
    defaultUser.setPassword("password");
    assertEquals("test equal password", "password", defaultUser.getPassword());
    
    defaultUser.setId(1);
    
    assertEquals("test equal id", (Integer)1, defaultUser.getId());
  }
}
